// 库引入
import React, {Component} from 'react';
import {inject, observer} from 'mobx-react';
import classNames from 'classnames';
import {Link} from 'react-router-dom';

// 样式引入
import styles from './style.module.less';

@observer
class TextLink extends Component {
  render() {
    return (
      <Link className={classNames(styles.textLink, this.props.className)} style={this.props.style} to={this.props.to}>
        {this.props.value}
      </Link>
    );
  }
}

TextLink.defaultProps = {
  to: '/',
  value: ''
};

const InjectTextLink = inject(({someStore={}}) => ({someProps: someStore.attribute}))(TextLink);

export {
  TextLink,
  InjectTextLink
};